const blessings = [
  "愿你每天都有好心情 💖",
  "前程似锦，万事顺意 ✨",
  "好运连连",
  "愿梦想都能开花 🌸",
  "被世界温柔以待 🌷",
  "健康平安，快乐常伴 💪",
  "天冷了加衣！！！",
  "早点睡，少熬夜",
  "多喝水哦",
  "记得多吃水果",
  "要好好爱自己",
  "自信点，相信自己！",
  "张燕是最棒的",
  "保持微笑",
  "我想你了",
  "要好好吃饭哦",
  "心想事成，幸福美满 💕"
];

document.getElementById("openBtn").addEventListener("click", () => {
  document.getElementById("intro").style.display = "none";
  const bgm = document.getElementById("bgm");
  bgm.play();
  startBlessingExplosion();
});

function startBlessingExplosion() {
  const container = document.getElementById("blessings-container");

  setInterval(() => {
    const div = document.createElement("div");
    div.className = "bless-box";
    div.innerText = blessings[Math.floor(Math.random() * blessings.length)];

    // 随机样式
    const colors = ["#ff6f61", "#ffb347", "#6fd08c", "#66b3ff", "#b366ff", "#ff66b2", "#f9ca24", "#badc58"];
    div.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
    div.style.left = Math.random() * (window.innerWidth - 200) + "px";
    div.style.top = Math.random() * (window.innerHeight - 100) + "px";
    div.style.fontSize = 18 + Math.random() * 12 + "px";
    div.style.transform = `rotate(${Math.random() * 40 - 20}deg) scale(0)`;

    container.appendChild(div);

    // 动画“蹦”出来
    setTimeout(() => {
      div.style.transform = `rotate(${Math.random() * 40 - 20}deg) scale(1.1)`;
    }, 50);
    setTimeout(() => {
      div.style.transform = `rotate(${Math.random() * 40 - 20}deg) scale(1)`;
    }, 300);
  }, 300);
}
